Remove possible line-breaks from description.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 25 Apr 2006 18:55:37 +0000 (18:55 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 25 Apr 2006 18:55:37 +0000 (18:55 +0000)
gpsbabel/kml.c

index 33eba05000a63bf3259bd6239185e74e2f7724a9..531712ff595094811b5ab71cfa114630bcee1bec 100644 (file)
@@ -143,7 +143,16 @@ void wpt_name(const char *args, const char **unused)
 
 void wpt_desc(const char *args, const char **unused)
 {
-       if (args) wpt_tmp->description = xstrappend(wpt_tmp->description, args);
+       if (args) {
+               char *tmp, *c;
+               
+               tmp = xstrdup((char *)args);
+               c = lrtrim(tmp);
+               if (*c) {
+                       wpt_tmp->description = xstrappend(wpt_tmp->description, c);
+               }
+               xfree(tmp);
+       }
 }
 
 void wpt_coord(const char *args, const char **attrv)